from flask import Flask
from flask import request
from flask import render_template

app = Flask(__name__)
@app.route('/', methods=['POST', 'GET'])
def getUR():
    if request.method == 'POST':
        U = request.form['U']
        R = request.form['R']
        P = request.form['P']
        I=(ord(U)-48)/((ord(R)-48)+(ord(P)-48))
        V=I*(ord(R)-48)
        return render_template('result.html', I=I, U=U, P=P, R=R, V=V)
    else:
        return render_template('getUR.html')

if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)